<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<c:set var="page_title"  value="Day menu for day (${dayMenu.dayNumber + 1})"/>
<html>
<head>
    <title><c:out value="${page_title}"/></title>
</head>
<body>
<c:import url="../pagemenus/mainUserMenu.jsp"/>
<br/>
<h3><c:out value="${page_title}"/></h3>
<table>
    <tr>
        <th>eating menus</th>
        <td>act</td>
    </tr>
    <c:set var="dayMenuId" value="${dayMenu.id}"/>
    <c:set var="usersTableId" value="${dayMenu.usersTable.id}"/>
    <c:forEach var="eatingMenu" items="${dayMenu.eatingMenus}">
    <tr>
        <td>
            <spring:message code="eatingmenu.${eatingMenu.eatingType}"/>,
            <%--<c:out value="${eatingMenu.eatingType}"/>,--%>
            <c:out value="${fn:length(eatingMenu.eatingMenuRecipes)}"/> dishes
        </td>
        <td>
            <a href="<c:url value="/eatingmenu-get.html"><c:param name="usersTableId" value="${usersTableId}"/><c:param name="dayMenuId" value="${dayMenuId}"/><c:param name="id" value="${eatingMenu.id}"/></c:url>">View</a>
            &nbsp;&nbsp;&nbsp;
            <a href="<c:url value="/eatingmenu-remove.html"><c:param name="usersTableId" value="${usersTableId}"/><c:param name="dayMenuId" value="${dayMenuId}"/><c:param name="id" value="${eatingMenu.id}"/></c:url>">Remove</a>
        </td>
    </tr>
    </c:forEach>
    <tr>
        <td>
            <%--<form action="<c:url value="/eatingmenu-add.html"><c:param name="usersTableId" value="${usersTableId}"/><c:param name="dayMenuId" value="${dayMenuId}"/></c:url>">--%>
            <form action="<c:url value="/eatingmenu-add.html"/>">
                <input type="hidden" name="usersTableId" value="${usersTableId}">
                <input type="hidden" name="dayMenuId" value="${dayMenuId}">
                <input type="submit" value="add">
                <select name="eatingType">
                    <option value="BREAKFAST"><spring:message code="eatingmenu.BREAKFAST"/></option>
                    <option value="DINNER"><spring:message code="eatingmenu.DINNER"/></option>
                    <option value="LUNCH"><spring:message code="eatingmenu.LUNCH"/></option>
                    <option value="SUPPER"><spring:message code="eatingmenu.SUPPER"/></option>
                    <option value="OTHER"><spring:message code="eatingmenu.OTHER"/></option>
                </select>
            </form>
        </td>
    </tr>
</table>

</body>
</html>